package main

import (
	"fmt"
	"github.com/micro/go-micro"
	"log"
	"micro_note/initialize/handler"
	hello_api "micro_note/initialize/proto/hello"
)

const (
	ServiceName = "demo.api"
)

func main() {
	service := micro.NewService(
		micro.Name(ServiceName),
		micro.Version("1.0.0"),
	)

	service.Init()

	//
	err := hello_api.RegisterHelloHandler(service.Server(), handler.NewHelloApi())
	if err != nil {
		fmt.Println(err)
	}

	// 启动api服务
	if err := service.Run(); err != nil {
		log.Fatal(err)
	}
}
